package common;

import java.text.DecimalFormat;
import java.text.NumberFormat;

public class NumberProcess {
	
	public static String number(Object num, Integer Idigit){
		NumberFormat NF = NumberFormat.getInstance();
		NF.setMinimumIntegerDigits(Idigit);
		NF.setGroupingUsed(false);
		return NF.format(num);
	}
	
	public static String number(Object num, Integer Idigit, boolean useGroup){
		NumberFormat NF = NumberFormat.getInstance();
		NF.setMinimumIntegerDigits(Idigit);
		return NF.format(num);
	}
	
	public static String floatNum(Object fNum, Integer digit){
		DecimalFormat df = new DecimalFormat();
		df.setMaximumFractionDigits(digit);
		return df.format(fNum);		
	}
	
}
